package com.yanmaohu.yulia.bean;

import java.util.List;

/**
 * @author Bright Lee
 */
public final class ColumnConstraintDefinitionList {

    private final int beginIndex;
    private final int endIndex;
    private final List<ColumnConstraintDefinition> columnConstraintDefinitionList;

    public ColumnConstraintDefinitionList(List<ColumnConstraintDefinition> columnConstraintDefinitionList) {
        this.beginIndex = columnConstraintDefinitionList.get(0).getBeginIndex();
        this.endIndex = columnConstraintDefinitionList.get(columnConstraintDefinitionList.size() - 1).getEndIndex();
        this.columnConstraintDefinitionList = columnConstraintDefinitionList;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public int size() {
        return columnConstraintDefinitionList.size();
    }

    public ColumnConstraintDefinition get(int index) {
        return columnConstraintDefinitionList.get(index);
    }

}
